<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>添加用户</title>

<script src="js/jquery.min.js"></script>
</head>
<script>
function login(){
	$.post("Login/login.action",{sqlId:"userMapper.getUserInfo",sqlParam:JSON.stringify({userId:$("input[name=userName]").val(),password:$("input[name=password]").val()})},function(data){
		if(data.state=="success"){
			location.href=document.referrer;
		}else{
			alert(data.msg);
		}
	},"json");
}
	
</script>
<body>
    <h1>登录</h1>
    	用户名：<input type="text" name="userName"> 
        	密码：<input type="password" name="password"> 
     <input type="button" value="登录" onclick="login()">
</body>
</html>